# @Filename:    Sample1-add
# @Author:      王佳伟
# @Time:        2025-02-28 9:25
# @Describe:    查找最大值
import unittest

def find_max(lst):
    if not lst:
        raise ValueError("List cannot be empty.")
    return max(lst)


class TestFindMax(unittest.TestCase):
    def test_find_max(self):
        self.assertEqual(find_max([1, 2, 3, 4, 5]), 5)
        self.assertEqual(find_max([-1, -2, -3, -4, -5]), -1)
        with self.assertRaises(ValueError):
            find_max([])


if __name__ == '__main__':
    unittest.main()
